Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

Q is empty.


QTRS
  ↳ DirectTerminationProof

Q restricted rewrite system:
The TRS R consists of the following rules:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

Q is empty.

We use [23] with the following order to prove termination.

Lexicographic path order with status [19].
Quasi-Precedence:
merge2 > <2 > [.2, if3]
nil > [.2, if3]
++2 > [.2, if3]
true > [.2, if3]
false > [.2, if3]

Status:
true: multiset
<2: [2,1]
++2: [2,1]
if3: [3,2,1]
false: multiset
merge2: [2,1]
.2: [2,1]
nil: multiset